home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp95 / chmodc.exe / lha / CHMOD.DOC next >
Text File  |  1987-12-28  |  6KB  |  150 lines

  1. /*
  2.  * CHMOD  --  A PC/MS-DOS File-Attribute Modification Program
  3.  *
  4.  * Copyright (c) Moderne Software 1987.  All rights reserved.
  5.  *
  6.  * Introduction
  7.  * ------------
  8.  *  The CHMOD program is a utility program that replaces the DOS ATTRIB program.
  9.  *  CHMOD does everything ATTRIB will do...and more.  It will allow you to view
  10.  *  the current attribute settings for ANY file.  It will also allow you to set
  11.  *  ANY of the available attributes (including the Hidden and System attributes)
  12.  *  on any file, including directory files.
  13.  *
  14.  * Command Line
  15.  * ------------
  16.  *  CHMOD
  17.  *  CHMOD filespec [-options...] [filespec [-options...]...]
  18.  *  CHMOD -V
  19.  *
  20.  *  Where:
  21.  *      filespec is a file specification with optional drive and path.
  22.  *               Wildcards are supported.  Backslash(\) and/or slash(/)
  23.  *               characters may be used as path separators.
  24.  *      options  are one or more of the supported option specifications.
  25.  *      -V       is a request to display the program version number.
  26.  *
  27.  *      Command line file and option specifications may be entered in upper
  28.  *      or lower case.
  29.  *
  30.  * Options
  31.  * -------
  32.  *      Options are specified after the file spec to which they refer.  Options
  33.  *      are preceded by a dash (-) character.  Multiple options may be specified
  34.  *      provided there are no spaces following each option.  For example,
  35.  *      "-a -s -h" and "-ash" are identical; "-a s h" is invalid as an option
  36.  *      specification.
  37.  *
  38.  *      Each option refers to a specific attribute associated with a certain
  39.  *      file.  For example, the -A option refers to the Archive attribute.
  40.  *      Attributes may be set or unset.  
  41.  *      
  42.  *      To set an attribute, a plus sign (+) must follow the attribute 
  43.  *      specification, as in -A+.  
  44.  *      
  45.  *      To unset (or clear) an attribute, a minus sign (-) or any character 
  46.  *      except a plus sign (+) must follow the attribute spec.  All of the
  47.  *      following option specs clear the Archive attribute: -A -A- -AH.
  48.  *
  49.  * Attributes
  50.  * ----------
  51.  *      -A      specifies the Archive attribute.
  52.  *
  53.  *      -H      specifies the Hidden attribute.
  54.  *
  55.  *      -R      specifies the Read-Only attribute.
  56.  *
  57.  *      -S      specifies the System attribute.
  58.  *
  59.  * Setting Attributes of Directories
  60.  * ---------------------------------
  61.  *      Attributes are intended to be used for normal files, but they can also
  62.  *      be set on directory files.  Directory files with the Archive, Hidden,
  63.  *      Read-Only, or System attributes set behave a little differently than
  64.  *      normal files with the same attributes.
  65.  *
  66.  *              Archive     : Unknown, may affect BACKUP.  This attribute
  67.  *                            is not set when a directory is created as it
  68.  *                            is when a normal file is first created or
  69.  *                            modified.
  70.  *
  71.  *              Read-Only   : No known effect.  Directory can still be
  72.  *                            RMDIR'ed.
  73.  *
  74.  *              Hidden      : DIR will not display directory; can still be
  75.  *                            CHDIR'ed and RMDIR'ed.
  76.  *
  77.  *              System      : Same effects as Hidden attribute.
  78.  *
  79.  *      To set the attributes of a directory file, include the special option
  80.  *      -D in the option specification.  For example:
  81.  *
  82.  *              CHMOD PASSWORD -DH+
  83.  *
  84.  *      will set the Hidden attribute for the PASSWORD directory.  If you do
  85.  *      not include the -D option spec, the Hidden attribute will not be set.
  86.  *
  87.  *      As another example:
  88.  *
  89.  *              CHMOD *.* -H+
  90.  *
  91.  *      will set the Hidden attribute on all files EXCEPT directory files.  To
  92.  *      set the Hidden attribute on all files, including directories, enter:
  93.  *
  94.  *              CHMOD *.* -DH+
  95.  *
  96.  * Program Output
  97.  * --------------
  98.  *      If no file specs are specified, a usage screen will be displayed.
  99.  *      If no options are specified, the current attributes of the specified
  100.  *      files are output.  Output format for each file spec is:
  101.  *
  102.  *      drash  <filespec>
  103.  *
  104.  *      where the existence of the:
  105.  *        'd'   : specifies the file is a Directory.
  106.  *        'r'   : specifies the Read-Only attribute is set for the file.
  107.  *        'a'   : specifies the Archive attribute is set for the file.
  108.  *        's'   : specifies the System attribute is set for the file.
  109.  *        'h'   : specifies the Hidden attribute is set for the file.
  110.  *
  111.  *      If the associated attribute is not set, the space will contain a
  112.  *      dash character.  For example:
  113.  *
  114.  *      -ra--  copy.com
  115.  *
  116.  *      indicates the file "copy.com" is not a subdirectory, is read-only,
  117.  *      has the archive bit set, and is not hidden nor is it a system file.
  118.  *
  119.  *      If options are specified, the specified attributes are set or cleared
  120.  *      and the new attribute settings are displayed for each specified file.
  121.  *
  122.  *      Given the above situation with the copy.com file, the following
  123.  *      command line will generate this output:
  124.  *
  125.  *      CHMOD COPY.COM -H+
  126.  *
  127.  *      -ra-h   copy.com
  128.  *
  129.  * History
  130.  * -------
  131.  * 28Dec87      Version 2.02
  132.  *              Pretty-print some of the source, adding comments.
  133.  *              Replace extern function prototypes of standard C library
  134.  *                      functions with appropriate #include directives.
  135.  *              Slight addition to usage screen.
  136.  * 10Oct87      Version 2.01
  137.  *              Construct file attribute with which to find wildcard matches
  138.  *                      in this file, rather than have expand_wildcard_filespec()
  139.  *                      use a default attribute.
  140.  *  7Sep87      Version 2.00
  141.  *              Complete rewrite of program.
  142.  *              Support wildcard file specs.
  143.  *              Reformat output.
  144.  *              Sort output files.
  145.  * 28Feb87      Version 1.1
  146.  *              Support directory attribute setting.
  147.  * 28Dec86      Version 1.0
  148.  *              Created.
  149.  */
  150.